<template>
  <div>
    <sort-bar>
      <template v-slot:left>
        <div class="left">热门歌手</div>
      </template>
      <template v-slot:right>
        <div class="right">查看更多&nbsp;&gt;</div>
      </template>
    </sort-bar>
    <loader v-if="!artistList"></loader>
    <div class="container" v-else>
      <div v-for="item in artistList" :key="item.id" class="artists">
        <img :src="item.img1v1Url" :alt="item.name" />
        <div class="artists-info">
          <p>{{item.name}}</p>
          <p>
            专辑数目：
            <span>{{item.albumSize}}</span>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import SortBar from "@/components/content/sortbar/SortBar";
import Loader from '@/components/common/loader/Loader'

export default {
  components: {
    SortBar,
    Loader
  },
  props: {
    artistList: {
      type: Array,
      default() {
        return []
      }
    }
  }
}
</script>

<style scoped>
.sort-bar >>> .left,
.sort-bar >>> .center,
.sort-bar >>> .right {
  flex: 8;
}

/* 标题区域 */
.left,
.right {
  font-size: 12px;
}
.left {
  font-weight: 700;
}
.right {
  cursor: pointer;
}

/* 歌手区域 */
.artists {
  cursor: pointer;
  margin: 20px 0;
  display: flex;
  background-color: #2f2f2f;
}

/* 歌手左边图片 */
.artists img {
  width: 60px;
  height: 60px;
}

/* 歌手名字信息 */
.artists-info p {
  width: 150px;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
  color: #fff;
  padding-left: 15px;
}
.artists-info span {
  color: #d81e06;
  font-size: 15px;
}
</style>